cmake_minimum_required(VERSION 3.20)
project(cpp01)

set(CMAKE_CXX_STANDARD 14)

#windows
#include_directories(“G:\\mysql\\MySQL8.0.17\\include”) # 刚刚说到的include文件夹的路径
#link_directories(“G:\\mysql\\MySQL8.0.17\\lib”) # lib文件夹的路径
#link_libraries(libmysql) # 直接写这个

#注意 windows下记得把libmysql.dll和libmysql.lib这两个文件拷贝到cmake-build-debug文件夹里


#mac
include_directories("/usr/local/mysql-5.7.30-macos10.14-x86_64/include")
include_directories("/usr/local/mysql-5.7.30-macos10.14-x86_64/lib")

#添加头文件搜索路径
include_directories(/usr/local/Cellar/boost/1.76.0/include)
#添加库文件搜索路径
link_directories(/usr/local/Cellar/boost/1.76.0/lib)

add_executable(cpp01 main.cpp Persion.cpp MysqlUtils.h MysqlUtils01.h)

#mac
target_link_libraries(cpp01 /usr/local/mysql-5.7.30-macos10.14-x86_64/lib/libmysqlclient.20.dylib)

#windows
#target_link_libraries(cpp01 libmysql) # 项目名称 libmysql